<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改日用水量')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-usage-edit" th:object="${waterUsage}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">户号：</label>
                <div class="col-sm-8">
                    <input name="loginName" th:field="*{loginName}" class="form-control" placeholder="请输入户号" type="text" readonly>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">用水日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        <input type="text" th:field="*{createTime}" name="createTime" class="form-control" id="createTime" placeholder="请选择用水日期">
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">用水量(m³)：</label>
                <div class="col-sm-8">
                    <input name="waterDemand" th:field="*{waterDemand}" class="form-control" placeholder="请输入用水量" type="number" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">用水金额(元)：</label>
                <div class="col-sm-8">
                    <input name="waterAmount" th:field="*{waterAmount}" class="form-control" type="number" placeholder="请输入用水金额" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />

    <script type="text/javascript">
        var prefix = ctx + "water/usage";

        $("#form-usage-edit").validate({
            focusCleanup: true
        });

        $("#createTime").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-usage-edit').serialize());
            }
        }
    </script>
</body>
</html>